﻿<%@ Page Language="C#" MasterPageFile="~/Admin/SiteAdmin.Master" AutoEventWireup="true" CodeBehind="DanhSachSanPham.aspx.cs" Inherits="DM.Web.Admin.QuanLySanPham.QuanLySanPham" Title="Công ty cổ phần Đường Man - Duong Malt JSC" %>
<%@ Import Namespace="DM.DAO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1 style="margin-bottom: 30px">Danh sách sản phẩm</h1>
    <br />
    <asp:DropDownList ID="DropDownListNgonNgu" runat="server" Width="150px" AutoPostBack="true">
        <asp:ListItem Text="Tiếng Việt" Value="1"></asp:ListItem>
        <asp:ListItem Text="Tiếng Anh" Value="2"></asp:ListItem>
    </asp:DropDownList>
    <br />
    <asp:GridView ID="GridViewSanPham" runat="server"  BackColor="White" BorderColor="#51A5B8"
        BorderStyle="Solid" BorderWidth="1px" CellPadding="4" GridLines="Horizontal" AllowPaging="True" AllowSorting="True" Width="100%" AutoGenerateColumns="False" EmptyDataText="Chưa có tin nào !" DataKeyNames="Ma" HorizontalAlign="Center"  EnableViewState="False" OnPageIndexChanging="GridViewSanPham_PageIndexChanging" OnRowDeleting="GridViewSanPham_RowDeleting" OnSorting="GridViewSanPham_Sorting">
        <RowStyle BackColor="GhostWhite" ForeColor="#333333" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
        <FooterStyle BackColor="#51A5B8" ForeColor="#333333" HorizontalAlign="Center" VerticalAlign="Middle" />
        <PagerStyle BackColor="#51A5B8" ForeColor="WhiteSmoke" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Wrap="False" Font-Overline="False" Font-Size="Smaller" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" Wrap="True" />
        <HeaderStyle BackColor="#51A5B8" Font-Bold="True" ForeColor="White" />
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
  	                <asp:Button ID="ButtonEdit" runat = "server" Text="Sửa" Width="38px" ForeColor="#0000C0" OnClick="ButtonEdit_Click" />
                </ItemTemplate>
                <EditItemTemplate>
                </EditItemTemplate>
                <ItemStyle BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Ti&#234;u đề" SortExpression="TieuDe">
                <ItemTemplate>
                    <asp:Label ID= "HyperLinkTieuDe" runat = "server" Text='<%#Common.FilterStringForColumn(Eval("TieuDe").ToString(),50)%>' />
                </ItemTemplate>
                <ItemStyle Wrap="True" BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="M&#244; tả" SortExpression="MoTa">
                <ItemTemplate>
                    <asp:Label ID ="LabelMoTa" runat = "server" Text='<%#Common.FilterStringForColumn(Eval("MoTa").ToString(),100)%>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Wrap="True" BorderColor="LightGray" BorderStyle="Dotted" BorderWidth="1px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Ng&#224;y đăng" SortExpression="NgayDang">
                <ItemTemplate>
                    <asp:Label ID="LabelNgayDang" runat="server" Text='<%#Eval("NgayDang","{0:dd/MM/yyyy}") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="View" SortExpression="LuotXem">
                <ItemTemplate>
                    <asp:Label ID="LabelLuotXem" runat="server" Text='<%#Eval("LuotXem") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
  	                <asp:Button ID="ButtonXoa" CssClass="art-button" runat="server" Text="Xóa" Width="38px" ForeColor="Red" OnClick="ButtonXoa_Click" />
                </ItemTemplate>
                <ItemStyle BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
                <EditItemTemplate>
                    <table>
                        <tr>
                        <td><asp:Button ID="ButtonDel" runat="server" ForeColor="Red"
                        Text="Ok" Width="35px" OnClick="ButtonDel_Click" /></td>
                        <td><asp:Button ID="ButtonNoDel" runat="server" ForeColor="Blue"
                        Text="No" Width="35px" OnClick="ButtonNoDel_Click" /></td>
                        </tr>
                    </table>
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EmptyDataRowStyle ForeColor="Red" />
        <AlternatingRowStyle BackColor="#C0D7DD" />
        <PagerSettings Mode="NumericFirstLast" PageButtonCount="3" />
        <EditRowStyle BackColor="#404040" BorderStyle="Solid" BorderWidth="1px"
            ForeColor="White" />
    </asp:GridView>
    <table width="100%">
        <tr>
            <td><asp:Button ID="btnThemMoi" runat="server" Width="80px" Text="Thêm mới" OnClick="btnThemMoi_Click"/></td>
        </tr>
    </table>   
</asp:Content>
